package service.impl;


import dao.mapper.CommentMapper;
import models.Comment;
import service.CommentService;

import java.util.ArrayList;
import java.util.List;

public class CommentServiceImpl implements CommentService {
    private CommentMapper commentMapper;
    private List<Comment> commentList = new ArrayList<>();

    @Override
    public boolean postComment(Integer uid,Integer pid,String commentText) {
        Comment comment = null;
        comment.setPid(pid);
        comment.setContent(commentText);
        comment.setCid(commentMapper.GetCommentNum()+1);
        comment.setUid(uid);
        return true;
    }

    @Override
    public void deleteComment(Integer commentID){
        commentMapper.DeleteComment(commentID);
    }
    @Override
    public List<Comment> getList(Integer photoID) {return null;}

    @Override
    public Comment getCommentByCid(Integer cid) {
        return commentMapper.GetCommentByCid(cid);
    }
}